<?php
use yii\helpers\Html;
use app\assets\AppAsset;
use yii\helpers\Url;

/* @var $this \yii\web\View */
/* @var $content string */

AppAsset::register($this);
?>
<?php $this->beginPage() ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <?=Html::cssFile('@web/easyui/themes/ui-cupertino/easyui.css')?>
    <?=Html::cssFile('@web/easyui/themes/icon.css')?>

    <?=Html::jsFile('@web/easyui/jquery.min.js')?>
    <!--上传包含-->
    <?=Html::jsFile('@web/js/upload/jquery.iframe-transport.js')?>
    <?=Html::jsFile('@web/js/upload/jquery.ui.widget.js')?>
    <?=Html::jsFile('@web/js/upload/jquery.fileupload.js')?>
    <!--上传结束-->
    <?=Html::jsFile('@web/easyui/jquery.easyui.min.js')?>

    <script type="text/javascript" src="easyui/locale/easyui-lang-zh_CN.js" charset="gb2312"></script>

    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script>
        $(function(){
            $("#tabs").tabs({
                fit : true,
                border : false
            });

            $("#btnEditPassword").linkbutton({
                iconCls : "icon-edit",
                onClick : function(){
                    $("#winEditPassword").window({
                        width:600,
                        height:400,
                        iconCls : "icon-edit",
                        title:"修改密码",
                        href: 'editPassword.html',
                        minimizable : false,
                        maximizable : false,
                        modal:true
                    });
                }
            });

            $("#btnQuit").linkbutton({
                iconCls : "icon-clear",
                onClick : function(){
                    $.messager.confirm('退出提示','确定要退出系统吗?',function(msg){
                        if (msg){
                            alert("退出系统");
                        }
                    });
                }
            });

            var menuList=null;
            //获取服务端返回的菜单设置，存放在menuList中
            $.ajax({
                type: "post",
                url: "<?=Url::to(['/admin/index/getmenu'])?>",
                cache: false,
                async: false,  //设置同步了~~~~~~~~~
                dataType: "json",
                data: { "method": "isExistInfoTitle", "intInfoID": $("#intInfoID").val() },
                success: function (data) {
                   
                    menuList=eval(data);
                }
            });
            //循环绑定菜单
            $(menuList).each(function()
                {
                    console.log(this);
                    $("#"+this.element).tree({
                        data:this.menu,
                        lines : true,
                        formatter:function(node){
                            var s = node.text;
                            if (node.children){
                                s += '&nbsp;<span style=\'color:blue\'>(' + node.children.length + ')</span>';
                            }
                            return s;
                        },
                        onClick : function(node){
                            if(node.url){
                                if($("#tabs").tabs("exists",node.text)){
                                    $("#tabs").tabs("select",node.text)
                                }else{
                                    $("#tabs").tabs("add",{
                                        title : node.text,
                                        closable : true,
                                        iconCls : node.iconCls,
                                        href : node.url
                                    });
                                }
                            }
                        }
                    });
                }
            );


            var jsondates=null;




        });
    </script>
    <?php $this->head() ?>
</head>



<body class="easyui-layout">
<div region="north" split="false" border="false" style=" height: 60px; line-height: 60px; ">
    <span style="padding-left:10px; font-size: 32px;"><img src="images/logo.gif" width="40" height="40" align="absmiddle"> 后台管理系统</span>
        <span style="float:right; padding-right:20px; font-size:12px;">
            欢迎你，
        <a href="javascript:;" id="btnEditPassword">修改密码</a>
        <a href="javascript:;" id="btnQuit">安全退出</a>
        </span>
</div>
<div data-options="region:'south'" style="height:30px; text-align:center; line-height:25px;">&copy; 版权所有</div>
<div data-options="region:'west',split:true,title:'功能菜单',iconCls:'icon-man'" style="width:200px;">
    <div class="easyui-accordion" fit="true" >
        <div title="系统管理" data-options="iconCls:'icon-ok'" style="overflow:auto;padding:10px;">
            <ul id="menu_sys"></ul>
        </div>
        <div title="会员管理" data-options="iconCls:'icon-help'" style="padding:10px;">
            <ul id="menu_user"></ul>
        </div>
        <div title="报表管理" data-options="iconCls:'icon-search'" style="padding:10px;">
            <ul id="menu_report"></ul>
        </div>
        <div title="网站管理" data-options="iconCls:'icon-remove'" style="padding:10px;">
            <ul id="menu_info"></ul>
        </div>
        <!--         <div title="基础配置" data-options="iconCls:'icon-help'" style="padding:10px;">
                    <ul id="menu_user"></ul>
                </div>
                <div title="用户管理" data-options="iconCls:'icon-ok'" style="overflow:auto;padding:10px;">
                    <ul id="menu_usermanage"></ul>
                </div>
               <div title="报表管理" data-options="iconCls:'icon-search'" style="padding:10px;">-->
<!--            <ul id="menu_report"></ul>-->
<!--        </div>-->
<!--        <div title="网站管理" data-options="iconCls:'icon-remove'" style="padding:10px;">-->
<!--            <ul id="menu_info"></ul>-->
<!--        </div>-->
    </div>
</div>
<div data-options="region:'center'" style="overflow:hidden;">
    <div id="tabs">
        <?= $content ?>
    </div>
</div>


<div id="winEditPassword"></div>
</body>


</html>
<?php $this->endPage() ?>







